package edu.jhu.cs.oose.scheduleit.vo;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;

import edu.jhu.cs.oose.scheduleit.util.ScheduleType;

/**
 * Entity class of UserSchedule
 * @author oose_group2
 *
 */
@Entity
public class UserSchedule {
	
	/**
	 * The identifier of this class
	 */
	@SuppressWarnings("unused")
	@Id
	@GeneratedValue
	private int id;
	
	/**
	 * The user who owns this schedule
	 */
	@SuppressWarnings("unused")
	@OneToOne
	private User user;
	
	/**
	 * The schedule which is owned the user
	 */
	@SuppressWarnings("unused")
	@OneToOne
	private Schedule schedule;
	
	/**
	 * The type of this schedule
	 */
	@Enumerated(EnumType.STRING)
	private ScheduleType type;
	
	/**
	 * Constructor of this class
	 */
	public UserSchedule(){
		
	}
	
	/**
	 * Constructor of this class
	 * @param user	
	 * @param schedule
	 * @param type
	 */
	public UserSchedule(User user, Schedule schedule, ScheduleType type){
		this.user = user;
		this.schedule = schedule;
		this.type = type;
	}

	/**
	 * The getter of type
	 * @return
	 */
	public ScheduleType getType() {
		return type;
	}
}
